package com.wenwen.social.application.dto;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class PageResult<T> {

	List<T> list = new ArrayList<T>();
	Integer pageSize = 0;
	Integer pageNum = 0;
	Integer totalRows = 0;
	Integer totalPageNum = 0;

	public PageResult(){

	}

    public PageResult(List<T> list, Integer pageNum, Integer pageSize, Integer totalRows) {
        this.list = list;
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        this.totalRows = totalRows;
        this.totalPageNum = totalRows % pageSize > 0 ? totalRows / pageSize+ 1 : totalRows / pageSize;
    }

}
